import xadmin
from pay_cost.models import PayCostModel


class PayCostModelAdmin():
    list_display = ['get_name', 'get_school','get_grand','get_grand','get_class','get_student_id','get_id_number','pay_time', 'pay_type', 'pay_lines', ]

    def get_name(self, obj):
        return '%s ' % obj.stuinfo.name

    get_name.short_description = '姓名'

    def get_school(self, obj):
        return '%s ' % obj.stuinfo.school

    get_school.short_description = '学校'

    def get_grand(self, obj):
        return '%s ' % obj.stuinfo.grade

    get_grand.short_description = '年级'

    def get_class(self, obj):
        return '%s ' % obj.stuinfo.the_class

    get_class.short_description = '班级'

    def get_student_id(self, obj):
        return '%s' % obj.stuinfo.student_id

    get_student_id.short_description = '学号'

    def get_id_number(self, obj):
        return '%s' % obj.stuinfo.id_number

    get_id_number.short_description = '身份证号'


xadmin.site.register(PayCostModel, PayCostModelAdmin)
